package com.liangjie.upload;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UpLoad extends HttpServlet {

	private static final long serialVersionUID = 1L;

	/**
	 * 处理文件上传
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		InputStream in = request.getInputStream();
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		String str = null;
		while ((str=reader.readLine()) != null) {
			System.out.println(str);
		}
		in.close();
		reader.close();
	}

}
